349 void RuleSet10Based(
int a_no_hunters, vector<int>* a_farmsizes, vector<HunterInfo>* a_hunterlist, vector<APoint>* a_roostlocs,
int a_ruleset );
353 void SaveFarmHunters( vector<HunterInfo>* a_hunterlist,
int a_no_hunters );
365 bool CheckDensity(
int a_ref, vector<int> *a_illegalfarms, vector<FarmOccupcancyData>* a_FarmOccupancy);
@ gst_foobar
Definition: Goose_Base.h:66
TypeOfHunterState
Hunters like other ALMaSS animals work using a state/transition concept. These are the hunter behavio...
Definition: Hunters_all.h:56
@ tohts_foobar
Definition: Hunters_all.h:61
@ tohts_OutHunting
Definition: Hunters_all.h:59
@ tohts_Hunting
Definition: Hunters_all.h:58
@ tohts_Resting
Definition: Hunters_all.h:60
@ tohts_InitialState
Definition: Hunters_all.h:57
TTypeOfHunters
Definition: Hunters_all.h:46
@ toh_GooseHunter
Definition: Hunters_all.h:47
@ toh_foobar
Definition: Hunters_all.h:48
vector< Hunter * > HunterList
Definition: Hunters_all.h:111
TypeOfHunterLeaderMessage
Types of message a hunter leader can pass on to team members.
Definition: Hunters_all.h:69
@ hlm_gohome
Definition: Hunters_all.h:71
@ hlm_shoot
Definition: Hunters_all.h:70
@ hlm_foobar
Definition: Hunters_all.h:72
A simple class defining an x,y coordinate set.
Definition: ALMaSS_Setup.h:53
The base class for all farm types.
Definition: farm.h:768
Definition: elements.h:728
The class to handle all goose population related matters.
Definition: Goose_Population_Manager.h:393
The class for goose hunters encompsassing all their specific behaviours.
Definition: Hunters_all.h:269
virtual void ResetBag()
Sets the annual hunting bag to zero.
Definition: Hunters_all.h:320
virtual ~GooseHunter()
GooseHunter destructor.
Definition: Hunters_all.cpp:1207
virtual void OnGoHome()
On gohome message handler.
Definition: Hunters_all.cpp:1438
bool IsLeader()
Returns the leader flag.
Definition: Hunters_all.h:325
virtual void Step()
GooseHunter Step code.
Definition: Hunters_all.cpp:1446
virtual bool InSeason(int day)
Is it goose hunting season? - MUST be overridden in descendent class.
Definition: Hunters_all.cpp:1271
void OnShotABird(int a_birdtype, int a_poly)
Message received when a goose is successully shot.
Definition: Hunters_all.cpp:1413
bool FindHuntingLocation(void)
Locate the hunt for today.
virtual int CheckForGame(void)
If the hunter checks for game at their hunting locations then this is done here. Must be overridden.
Definition: Hunters_all.cpp:1231
bool m_dugin
Flag to show whether a hunting location has been found.
Definition: Hunters_all.h:277
bool m_leader
When hunting this indicates whether the hunter is a team leader.
Definition: Hunters_all.h:285
virtual bool IsSeasonEnd(int day)
Is it the end of the goose hunting season? - MUST be overridden in descendent class.
Definition: Hunters_all.cpp:1260
virtual int GetSeasonLengthLeft(int day)
Returns the length of the hunting season in days - MUST be overridden in descendent class.
Definition: Hunters_all.cpp:1296
virtual void OnShoot()
On shoot message handler.
Definition: Hunters_all.cpp:1419
int m_pinkfootbaglimit
Bag limit for pinkfoot.
Definition: Hunters_all.h:281
int m_goosebag[gst_foobar]
A special bag data structure so the hunter knows what kind of geese he shot.
Definition: Hunters_all.h:279
int m_greylagbaglimit
Bag limit for greylag.
Definition: Hunters_all.h:283
virtual void SaveMyData(ofstream *a_ofile)
Each hunter needs to save different kinds of data, so we use a polymorphic method for this.
Definition: Hunters_all.cpp:1469
GooseHunter(struct_Hunter *p_data, Hunter_Population_Manager *p_PPM)
GooseHunter constructor.
Definition: Hunters_all.cpp:1197
virtual TypeOfHunterState st_ShouldGoHunting(void)
Behavior involved in deciding whether to go hunting.
Definition: Hunters_all.cpp:1315
polylist * m_huntfields
Our list of possible hunting fields as polygon reference numbers as supplied by Landscape::SupplyPoly...
Definition: Hunters_all.h:275
virtual void Init()
Initiation of a specific goose hunter here.
Definition: Hunters_all.cpp:1212
Goose_Population_Manager * m_preyPopulationManger
Pointer to our game population, the geese.
Definition: Hunters_all.h:273
TypeOfHunterState st_OutHunting(void)
The basic hunting behaviour.
Definition: Hunters_all.cpp:1332
The class to handle all predator population related matters.
Definition: Hunters_all.h:335
APoint GetHunterHome(int a_index, int a_list)
Returns the hunter home location.
Definition: Hunters_all.cpp:1016
Hunter_Population_Manager(Landscape *p_L)
Hunter population manager constructor.
Definition: Hunters_all.cpp:119
virtual void DoFirst()
Does general daily tasks e.g. reset time of day, reset bag lists if start of year etc....
Definition: Hunters_all.cpp:947
virtual ~Hunter_Population_Manager(void)
Hunter population manager destructor.
Definition: Hunters_all.cpp:141
bool AddHunterHunting(int a_polyref, Hunter *a_hunter)
Adds a hunter hunting, returns true if that hunter is the leader otherwise false.
Definition: Hunters_all.cpp:1478
virtual void DoAfter()
Available for hunter management - not used currently.
Definition: Hunters_all.h:402
void HunterLeaderMessage(TypeOfHunterLeaderMessage a_signal, int a_polyref)
A message system to rely messages from the leader hunter to others in his team.
Definition: Hunters_all.cpp:1027
int m_HuntingSeasonEnd
End of the overall hunting season.
Definition: Hunters_all.h:392
APoint GetHunterHuntLoc(int a_index, int a_list, unsigned a_ref)
Returns the hunter hunting location location.
Definition: Hunters_all.cpp:1021
bool IsPolyrefOnActiveList(int a_polyref)
Debugging check method.
Definition: Hunters_all.cpp:1059
virtual void DoLast()
Available for hunter management - not used currently.
Definition: Hunters_all.h:404
unsigned GetNoHuntLocs()
Calculates the number of hunting locations based on a distribution.
Definition: Hunters_all.cpp:186
ofstream * m_HuntingBagRecord
Output file for hunting bag record.
Definition: Hunters_all.h:388
bool CheckDensity(int a_ref, vector< int > *a_illegalfarms, vector< FarmOccupcancyData > *a_FarmOccupancy)
helper method to reduce code size in hunter rules - checks density rules
Definition: Hunters_all.cpp:300
void RuleSet10Based(int a_no_hunters, vector< int > *a_farmsizes, vector< HunterInfo > *a_hunterlist, vector< APoint > *a_roostlocs, int a_ruleset)
Used to implement rule sets based on rule set 10.
Definition: Hunters_all.cpp:800
int m_HuntingSeasonStart
Start of the overall hunting season.
Definition: Hunters_all.h:390
int GetHuntingSeasonEnd()
Get the end of the overall hunting season.
Definition: Hunters_all.h:381
vector< int > m_ActiveHuntingLocationsPolyrefs
Lists of polygon reference numbers for all active hunting locations (updated daily)
Definition: Hunters_all.h:373
void SaveDistributedHunters(vector< HunterInfo > *a_hunterlist, int a_no_hunters)
Saves the results of the hunter distribution to an output file.
Definition: Hunters_all.cpp:198
void DistributeHuntersByRules(vector< HunterInfo > *a_hunterlist, int a_no_hunters, int a_ruleset)
Implements the rule sets to distributes hunters to hunting locations (farms).
Definition: Hunters_all.cpp:346
void DistributeHunters(void)
Distributes hunters to hunting locations (farms).
Definition: Hunters_all.cpp:151
virtual void DoBefore()
Available for hunter management - not used currently.
Definition: Hunters_all.h:400
void CreateObjects(int ob_type, TAnimal *, struct_Hunter *data, int number)
Creates hunter objects and assigns them to the population manager lists.
Definition: Hunters_all.cpp:925
unsigned m_daytime
Used to follow the time of day in 10 minute steps.
Definition: Hunters_all.h:386
vector< HunterList * > m_ActiveHuntingLocationsHunters
Lists of hunters at all active hunting locations (updated daily)
Definition: Hunters_all.h:371
int GetHuntingSeasonStart()
Get the start of the overall hunting season.
Definition: Hunters_all.h:379
void SaveFarmHunters(vector< HunterInfo > *a_hunterlist, int a_no_hunters)
Saves the results of the hunter distribution to an output file by farm.
Definition: Hunters_all.cpp:233
void RecordHuntingSuccess(int poly, int birds, int a_hunter)
Hunting bag output.
Definition: Hunters_all.cpp:1002
void Init(void)
Create the initial hunter population and initializes any output options.
Definition: Hunters_all.cpp:837
virtual bool StepFinished()
Overrides the population manager StepFinished - there is no chance that hunters do not finish a step ...
Definition: Hunters_all.h:396
void SetHuntingSeason()
This returns the number of geese which are legal quarry on the polygon the day before.
Definition: Hunters_all.cpp:1498
The base class for hunters encompsassing all their general behaviours.
Definition: Hunters_all.h:121
Hunter_Population_Manager * m_OurPopulationManager
Pointer to the population manager.
Definition: Hunters_all.h:129
virtual ~Hunter()
The destructor for the Hunter class.
Definition: Hunters_all.cpp:1081
int m_baglimit
Annual self-imposed limit on number shot - unused at present.
Definition: Hunters_all.h:143
vector< int > m_HuntLocRefs
Definition: Hunters_all.h:161
virtual bool IsSeasonEnd(int)
Is it the end of the hunting season? - MUST be overridden in descendent class.
Definition: Hunters_all.h:246
int m_weekend
Code for weekly hunting activity.
Definition: Hunters_all.h:151
TypeOfHunterState st_Resting(void)
Finished hunting and waiting for the next opportunity.
Definition: Hunters_all.cpp:1185
double m_goosecountchance
Probability of checking for geese in hunting area.
Definition: Hunters_all.h:149
int GetHuntField()
Get the polygon reference number to our current hunting field (which is at a hunting location)
Definition: Hunters_all.h:234
int m_myname
A reference number unique to this hunter.
Definition: Hunters_all.h:125
int GetShots()
Gets the number of shots this season to-date.
Definition: Hunters_all.h:197
Farm * GetFarmerRef(unsigned a_ref)
Provide our ref name.
Definition: Hunters_all.h:240
virtual void SaveMyData(ofstream *)
Each hunter needs to save different kinds of data, so we use a polymorphic method for this.
Definition: Hunters_all.h:254
vector< APoint > m_HuntLocs
Definition: Hunters_all.h:163
bool IsTodayAPreferredHuntDay(int a_today)
Checks for the hunting day preference (weekday or any day)
Definition: Hunters_all.cpp:1137
APoint GetHuntLoc(unsigned a_ref)
Provide our hunting location coords.
Definition: Hunters_all.h:238
TypeOfHunterState m_CurrentHState
The current hunter behavioural state.
Definition: Hunters_all.h:127
APoint m_Home
Definition: Hunters_all.h:155
virtual int GetSeasonLengthLeft(int)
Returns the length of the hunting season in days - MUST be overridden in descendent class.
Definition: Hunters_all.h:250
virtual void OnShoot()
On shoot message handler - must be overidden in descendent classes.
Definition: Hunters_all.h:258
virtual void ResetBag()
Sets the annual hunting bag to zero.
Definition: Hunters_all.h:201
void ResetHuntingOpportunities()
Sets the annual hunting attempts count to zero.
Definition: Hunters_all.h:206
int m_lasthuntday
The date for the last hunt day.
Definition: Hunters_all.h:141
double m_efficiency
Probability of 'hitting' a game item.
Definition: Hunters_all.h:147
APoint GetHome()
Provide our home coords.
Definition: Hunters_all.h:232
void ResetSeasonData()
Sets the bag and hunting counters to zero.
Definition: Hunters_all.h:218
int GetHuntingDays()
Gets the annual hunting attempts count.
Definition: Hunters_all.h:189
virtual int CheckForGame(void)
If the hunter checks for game at their hunting locations then this is done here. Must be overridden.
Definition: Hunters_all.h:179
vector< Farm * > m_OurFarmers
List of pointers to the farmers whose land the hunter hunts
Definition: Hunters_all.h:153
bool IsTodayAChosenHuntDay(int a_today)
Uses a probability test to determine whether to go hunting today.
Definition: Hunters_all.cpp:1158
int m_myShots
The numbers of shots to-date this year.
Definition: Hunters_all.h:135
int GetBag()
Gets the annual hunting bag.
Definition: Hunters_all.h:193
int m_myMagazine
The number of shells in the magazine.
Definition: Hunters_all.h:137
int GetClock()
Supplies the clock time.
Definition: Hunters_all.h:210
virtual TypeOfHunterState st_ShouldGoHunting(void)
Decide whether to go out hunting on a specific day.
Definition: Hunters_all.cpp:1109
virtual bool InSeason(int)
Is it hunting season? - MUST be overridden in descendent class.
Definition: Hunters_all.h:242
int m_huntfield_polyref
The polygon reference number to our current hunting field (which is at a hunting location)
Definition: Hunters_all.h:157
Hunter(struct_Hunter *p_data, Hunter_Population_Manager *p_PPM)
The constructor for the Hunter class.
Definition: Hunters_all.cpp:1075
virtual void Init(struct_Hunter *p_data)
Initiation of a basic hunter here.
Definition: Hunters_all.cpp:1086
bool IsOutHunting()
A debug function, but may be useful in other contexts. Returns true of currently out hunting.
Definition: Hunters_all.h:223
TypeOfHunterState st_OutHunting(void)
The basic hunting behaviour.
Definition: Hunters_all.cpp:1177
int m_huntlimit
Annual self-imposed limit on number of days spent hunting.
Definition: Hunters_all.h:145
int m_bag
The numbers of game items shot todate this year.
Definition: Hunters_all.h:133
int GetRef()
Provide our ref name.
Definition: Hunters_all.h:230
int m_NoHuntLocs
Definition: Hunters_all.h:159
int m_huntingdays
The numbers of days used for hunting this year.
Definition: Hunters_all.h:139
void ResetClock()
Sets the clock back to zero.
Definition: Hunters_all.h:214
virtual void OnGoHome()
On gohome message handler - must be overidden in descendent classes.
Definition: Hunters_all.h:260
void OnMorning()
Optimism in the morning, perhaps we should hunt?
Definition: Hunters_all.h:228
int m_clock
Records the time spent hunting per day.
Definition: Hunters_all.h:131
The landscape class containing all environmental and topographical data.
Definition: landscape.h:113
Base class for all population managers.
Definition: PopulationManager.h:424
The base class for all ALMaSS animal classes.
Definition: PopulationManager.h:205
Used for creation of a new hunter object.
Definition: Hunters_all.h:80
double m_goosecountchance
Definition: Hunters_all.h:93
unsigned m_no_hunt_locs
Definition: Hunters_all.h:87
double m_efficiency
Definition: Hunters_all.h:92
int m_HType
Definition: Hunters_all.h:83
int m_ref
Definition: Hunters_all.h:82
int m_huntingdayslimit
Definition: Hunters_all.h:90
vector< int > m_huntlocrefs
Definition: Hunters_all.h:85
APoint m_validxy
Definition: Hunters_all.h:88
Landscape * m_L
Definition: Hunters_all.h:94
vector< APoint > m_huntlocs
Definition: Hunters_all.h:86
Population_Manager * m_preyPM
Definition: Hunters_all.h:95
APoint m_home
Definition: Hunters_all.h:84
int m_weekend
Definition: Hunters_all.h:91
vector< Farm * > m_farms
Definition: Hunters_all.h:89
vector< unsigned > polylist
Definition: farm.h:207
Definition: Hunters_all.h:103
int m_no_hunters
Definition: Hunters_all.h:105
int m_FarmRef
Definition: Hunters_all.h:104